package com.bw.module_notice.viewmodel

import androidx.lifecycle.viewModelScope
import com.bw.module_notice.repo.NoticeRepo
import com.bw.lib_common.vm.BaseViewModel
import com.yuwei.http.entity.NoticeEntity
import kotlinx.coroutines.launch

class NoticeViewModel: BaseViewModel<NoticeEntity>() {
    private val noticeRepo = NoticeRepo()

    fun getNoticeList(userId : Int){
        viewModelScope.launch {
            val result = noticeRepo.getNoticeList(userId)
            if (result.code == 200){
                mSuccessLiveData.value = result.data
            }else{
                mErrorLiveData.value = result.message
            }
        }
    }
}